Avoid super-luminous pixels
authorMatthias Clasen <mclasen@redhat.com>
Thu, 19 Oct 2017 13:15:13 +0000 (15:15 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 19 Oct 2017 13:16:54 +0000 (15:16 +0200)
The color-matrix shader was creating pixels with r,g,b > a in
some cases, which leads to unexpected test failures. In particular
this as visible the opacity render node test for opacity 0.

gsk/resources/vulkan/color-matrix-clip-rounded.frag.spv
gsk/resources/vulkan/color-matrix-clip.frag.spv
gsk/resources/vulkan/color-matrix.frag
gsk/resources/vulkan/color-matrix.frag.spv

index 2025e85572dbdf2eac118d497f3a56de4b3feea0..d25714ea8fedd85a121a86dc2c1b2d698e733cab 100644 (file)
Binary files a/gsk/resources/vulkan/color-matrix-clip-rounded.frag.spv and b/gsk/resources/vulkan/color-matrix-clip-rounded.frag.spv differ
index ec29f263bbba778e7ab642765ce84ce77d97e369..a9bd797c0062d81f3dcdd322f2b24c8e915d84cf 100644 (file)
Binary files a/gsk/resources/vulkan/color-matrix-clip.frag.spv and b/gsk/resources/vulkan/color-matrix-clip.frag.spv differ
index 00b7947286ccfcfc987c01778fb075e6084e4f03..8787eb443f2a36b9791bc2acb7d8dfab85a5d03b 100644 (file)
@@ -22,8 +22,7 @@ color_matrix (vec4 color, mat4 color_matrix, vec4 color_offset)
   color = clamp(color, 0.0, 1.0);
 
   /* premultiply */
-  if (color.a != 0.0)
-    color.rgb *= color.a;
+  color.rgb *= color.a;
 
   return color;
 }
index ec29f263bbba778e7ab642765ce84ce77d97e369..a9bd797c0062d81f3dcdd322f2b24c8e915d84cf 100644 (file)
Binary files a/gsk/resources/vulkan/color-matrix.frag.spv and b/gsk/resources/vulkan/color-matrix.frag.spv differ